package com.ruoyi;

import cn.hutool.core.thread.ThreadUtil;
import com.xaslsoft.xaslsoft.device.rfid.usb.factory.IUsbFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;

/**
 * 启动程序
 *
 * @author ruoyi
 */

@SpringBootApplication(scanBasePackages = {"com.xaslsoft", "com.ruoyi"})
public class RuoYiApplication {

	@Autowired
	IUsbFactory usbFactory;
	public static void main(String[] args) {
		System.setProperty("spring.devtools.restart.enabled", "false");
		SpringApplication.run(RuoYiApplication.class, args);
		System.out.println("(♥◠‿◠)ﾉﾞ  Xaslsoft-Boot-Vue启动成功   ლ(´ڡ`ლ)ﾞ");

	}

	@PostConstruct
	private void init() {
		usbFactory.connect("COM3", 115200);
		ThreadUtil.safeSleep(2000);
		usbFactory.startRead();

		ThreadUtil.safeSleep(2000);
		usbFactory.stopRead();
	}

}
